home *** CD-ROM | disk | FTP | other *** search
-
-
- CCDB Diskette File Utility Program
-
- I. Introduction
-
- The purpose of the utility program ('UTILITYC.EXE' is the
- compiled version, 'UTILITYC.BAS' is the BASIC source code) is to
- enable users to partition and recombine the CCDB data files to
- suit their special needs. The program is designed for the
- counties and cities file sets. The program is not needed for and
- will not work with the place file set. UTILITYC is neither a data
- base system nor a sophisticated display program. UTILITYC may
- expedite the selection and reorganization of the data before
- entering a data base package.
-
- A. File Partitioning
-
- The program provides for vertical and horizontal partitions
- of files to be extracted. A vertical partition refers to a subset
- of data items or variables for all geographic areas. A
- horizontal partition refers to a subset of geographic areas for
- all data items. Simultaneous horizontal and vertical partitions
- are also possible (a subset of data items for a subset of
- geographic areas). Typical partition jobs are: selecting the
- State totals, selecting records for a single State, selecting
- SMSA counties.
-
- B. File Recombination
-
- If several data files include records for the same areas in the
- same sequence the user may next want to combine them into a file
- with longer records. This can be done in several steps with two
- input files and one output file used at each step. At each step,
- wanted items on the input files can be selected so that unwanted
- items do not appear on the output file. The utility program
- allows 2 files with identical record identifiers to be combined
- into an output file with the same record identifiers. The user
- can specify the data items to be selected from each file and
- their order in the output files. Data files can also be combined
- with the file containing area names and metropolitan area codes.
-
- C. Additional Functions
-
- Additional functions are included in the utility program to
- assist in the partitioning and recombining of data files. The
- program allows the user to list the files on the disks on the A
- or B drives; to list the data dictionary for a data file (see
- below); or to list the data in a data file. These functions can
- be accessed without leaving the utility program.
-
-
-
-
-
- D. Data Dictionaries
-
- Each data file in the CCDB set has an associated data dictionary
- file that contains a record for each data item in the data file.
- The utility program automatically generates a data dictionary
- file for each partition and recombination produced. Data
- Dictionary file names and data file names are related. Data files
- have the extension '.TXT'. Dictionary files use the same base
- name and the extension '.DCT'. These data dictionaries should not
- be confused with the consolidated data dictionary for the entire
- file set, CNTYDICT.DOC and CITYDICT.DOC. The data dictionaries
- referred to in this document are the abbreviated ones found on
- the same disk as the associated data file. When copying data
- files be sure to always copy the associated data dictionary file.
- UTILITYC will not operate on a data file if the associated data
- dictionary file is not present on the same disk.
-
- (Dictionaries are not present on the data disks for the State
- edition. One set of dictionaries is provided on the U.S. Summary
- disk (C34). The dictionaries may be copied onto the data disks
- prior to use of the UTILITYC program. The names of the data files
- are not the same for all of the States. The State code is
- appended to the base part of the data file name. File 10 for
- Alabama (State code 01) is not merely CCDB10 but CCDB1001. When
- copying the dictionaries for a particular State, the State code
- should be appended onto the base part of the file name.
- Alternatively, the State codes could be removed from the data
- file names. Then the dictionaries could be copied without
- changing their names. Since a maximum of 112 files are allowed on
- a double sided diskette, and since 70 files comprise the county
- and city data sets, it is not possible to place all of the
- associated dictionary files on the diskette with the data files.)
-
-
- II. A Demonstration of the Program.
-
- If you have not yet made a working copy of the CCDB disks do so
- before proceeding. Do not use your master copies. The following
- demonstration assumes a system with two disk drives
- designated A and B. If you have a system where a second drive
- has a designation other than B, substitute that
- designation wherever the letter B appears in the
- following demonstration.
-
- The following demonstration uses county data. Similar examples
- could be carried out using city data. But sample files for cities
- are not provided. To apply these examples using city data files,
- substitute a four digit city code wherever a three digit county
- code is indicated in the following demonstration.
-
-
-
-
-
-
- A. The Master Menu
-
- Insert the Documentation/software Disk into drive A. Insert a
- second disk into drive B. This disk must not be write protected
- and must have at least 100,000 bytes of freespace available.
- After the A> prompt enter 'UTILITYC'. (If the compiled version of
- UTILITYC does not work then remove the disk in drive A; insert a
- disk containing BASICA; copy BASICA onto the disk in drive B;
- reinsert the Documentation/software disk into drive A; and enter
- 'B:BASICA UTILITYC'.) The master menu will appear as shown in
- figure 1.
-
- ----------------------------------------------------------------
- MASTER MENU
- -----------------------------------------------------------
- 1. LIST FILE NAMES
- 2. LIST DICTIONARY FOR A DATA FILE
- 3. LIST DATA FROM A DATA FILE
- 4. PRODUCE A SUBSET OF A DATA FILE (VERTICAL AND/OR HORIZONTAL)
- 5. COMBINE TWO INPUT FILES INTO ONE OUTPUT FILE (VERTICAL)
- 6. PRODUCE A COPY OF A DATA FILE WITH AREA NAMES AND CODES ADDED
- 7. FINISHED
- -----------------------------------------------------------
- ENTER NUMBER :
- ----------------------------------------------------------------
- Figure 1. Master Menu
-
-
- B. Listing File Names
-
- Enter a '1', 'LIST FILE NAMES.' Next hit the RETURN (or ENTER)
- key. (It is to be understood from here on that no user response
- is complete until the user hits the RETURN or ENTER key.) The
- system will respond 'ENTER A FOR A DRIVE, B FOR B DRIVE.' Enter
- 'A'. The system will list the files on the Introductory disk as
- shown in figure 2.
-
- -------------------------------------------------------------------
- DEMO1 .DCT DEMO1 .TXT DEMONAME.TXT DEMO2 .DCT
- DEMO2 .TXT INTRODUC.DOC UTILITYC.BAS DBASEII .DOC
- UTILITYC.EXE MSANECMA.SDF CMSA .SDF PMSA .SDF
- CNTYDICT.DOC UTILITYC.DOC
-
- -------------------------------------------------------------------
- Figure 2. Display of the names of files on the Documentation/
- Software disk
-
- Note the five file names 'DEMO1.TXT', 'DEMO1.DCT', 'DEMO2.TXT',
- 'DEMO2.DCT' and 'DEMONAME.TXT'. These are the five files used in
- the rest of the demonstration. DEMO1.TXT is an extract from the
- first CCDB data file, CCDB01.TXT. The extract contains records
- for U.S. total, and all records for the States of Alabama and
- Alaska, a total of 93 records. DEMO2.TXT bears the same
- relationship to the second CCDB data file, CCDB02.TXT. DEMO1.DCT
- and DEMO2.DCT are simply copies of CCDB01.DCT and CCDB02.DCT, the
- data dictionary files for the first and second data files.
- DEMONAME.TXT is an extract from the file CCDB00.TXT. CCDB00.TXT
- contains a record with the area name and metropolitan area codes
- for all areas in the county file set. DEMONAME.TXT contains a
- record for each of the areas contained in DEMO1.TXT as just
- described. Hit the RETURN (or ENTER) key, the master menu
- reappears.
-
- C. Listing the Dictionary for a Data File
-
- Enter a '2' 'LIST THE DICTIONARY FOR A DATA FILE'. The system
- will ask for the name of a file. Enter 'DEMO1'. (Do not
- include the file suffix 'TXT' or'DCT'. This rule applies
- throughout the system when referring to data or dictionary files.
- Whenever a file name is requested, enter only the base part of
- the name.) The display appears on the screen as shown in figure
- 3a. The corresponding display for DEMO2 appears in figure 3b.
-
- -------------------------------------------------------------
- DATA DICTIONARY FOR FILE : DEMO1
- ---------------------------------------------
- 1. LAND8001 LAND AREA IN SQUARE MILES 1980
- 2. POPG7001 POPULATION (APRIL 1) 1980
- 3. POPG8001 POPULATION (APRIL 1) 1970
- 4. POPG8002 RANK OF COUNTY POPULATION 1980
- 5. POPG8003 POPULATION PER SQUARE MILE 1980
- 6. POPG8005 URBAN POPULATION 1980
- ---------------------------------------------
- HIT RETURN TO CONTINUE.
-
- fig. 3a
-
- DATA DICTIONARY FOR FILE : DEMO2
- ---------------------------------------------
- 1. POPG8009 WHITE POPULATION 1980
- 2. POPG8011 BLACK POPULATION 1980
- 3. POPG8013 AMERICAN INDIANS, ESKIMOS AND ALEUTS 1980
- 4. POPG8014 ASIAN AND PACIFIC ISLANDERS 1980
- 5. POPG8017 SPANISH-ORIGIN POPULATION 1980
- 6. POPG8040 FEMALE POPULATION 1980
- ---------------------------------------------
- HIT RETURN TO CONTINUE.
-
- figure 3b
- -------------------------------------------------------------
- Figure 3. Data dictionary displays for DEMO1 and DEMO2
-
- Each line of the display describes one data item in the file
- DEMODATA.TXT. Using this function, the user is able to see what
- data items are in a file. After the listing, the system again
- writes 'HIT RETURN TO CONTINUE.' Hit RETURN. The master menu
- appears.
-
-
-
- D. Listing Data from a Data File
-
- Enter a '3', 'LIST DATA FROM A DATA FILE'. The system first asks
- for an input file name. Enter 'DEMO1'. The system then responds
- with the question: 'DO YOU WISH TO SELECT A SUBSET OF RECORDS?
- (YES/NO): If you respond 'No' (just 'N' will do), all of the
- records in the file will be listed. Enter instead 'Y'. The
- record subset specification menu shown in figure 4 will appear.
-
- -----------------------------------------------------------------
- RECORD SUBSET SPECIFICATION OPTIONS
- ------------------------------------------------
- 1. USE CURRENT STATE-COUNTY CODE SPECIFICATIONS
- 2. DISPLAY CURRENT SPECIFICATIONS
- 3. OBTAIN SPECIFICATIONS FROM A FILE
- 4. SAVE CURRENT SPECIFICATIONS INTO A FILE
- 5. ENTER NEW SPECIFICATIONS
- 6. RETURN TO MASTER MENU
-
- (NOTE: FOR CITIES USE A FOUR DIGIT CITY CODE
- INSTEAD OF A THREE DIGIT COUNTY CODE.)
- ------------------------------------------------
- ENTER NUMBER:
-
- -----------------------------------------------------------------
- Figure 4. Record subset specification menu
-
-
- The first four options will be explained below. Enter a '5'
- 'ENTER NEW SPECIFICATIONS'. The instructions shown in figure 5
- appear.
-
- -----------------------------------------------------------------
- ENTER STATE-COUNTY CODES. THREE FORMS ARE VALID.
- -----------------------------------------------------------------
- FORM 1 : <STATE-COUNTY CODE>-<STATE-COUNTY CODE> SPECIFIES A
- RANGE
- FORM 2 : <STATE-COUNTY CODE> SPECIFIES A
- SINGLE AREA
- FORM 3 : SAME AS FORM 2 BUT CONTAINING DON'T CARE CHARACTERS
- ('?').
- E.G. ??000 SPECIFIES A GROUP OF 52 RECORDS: THE U.S. TOTAL
- RECORD, 50 STATE TOTAL RECORDS, AND A RECORD FOR THE DISTRICT OF
- COLUMBIA. FORM 3 MUST BE USED ALONE. FORMS 1 AND 2 MAY BE
- INTERMIXED AND REPEATED BUT ALL CODES MUST BE IN ASCENDING
- SEQUENCE.
- (NOTE: FOR CITIES USE A FOUR DIGIT CITY CODE
- INSTEAD OF A THREE DIGIT COUNTY CODE.)
- -----------------------------------------------------------------
- ENTER CODE(S) OR END:
-
- -----------------------------------------------------------------
- Figure 5. State-county code specification instructions
-
-
- Enter '??000'. The system will list the state-county codes
- selected (that is, '00000', '01000','02000'). Upon completion of
- the specifications, the system responds with the message 'THE
- AREA CODES SELECTED ARE NOW THE CURRENT SPECIFICATIONS.' followed
- by 'HIT RETURN TO CONTINUE.' Hit RETURN. The menu shown in figure
- 4 reappears. If the specifications are complex, they can be saved
- in a file using option 4 and recalled later using option 3. Room
- for a small file must be available. Any DOS-permitted name can
- be used. File extensions are not provided. The user may include
- them. The convention for data and dictionary file names (see
- section II B above) does not apply to specification files.
-
- Enter a '2', DISPLAY CURRENT SPECIFICATIONS'. The system will
- list the codes specified above as shown in figure 6.
-
- ---------------------------------
- AREAS CURRENTLY SPECIFIED
- -------------------------
- 00000
- 01000
- 02000
- -------------------------
- HIT RETURN TO CONTINUE.
-
- --------------------------------
- Figure 6. Sample area specification listing
-
- Hit RETURN. The system again returns to the menu shown in fig.3.
- Enter a '1' 'USE CURRENT STATE-COUNTY CODE SPECIFICATIONS'. This
- option is the 'exit and proceed' option and the only option that
- does not loop back to the menu shown in figure 3. The system
- responds with the question 'DO YOU WISH TO SELECT A SUBSET OF
- ITEMS? (YES/NO)'. Having specified a vertical subset of
- records, we are now faced with the decision of specifying a
- subset of items within each record. A 'No' answer means we want
- the entire record listed. Enter 'YES'. The system responds with
- 'Enter the position of one or more selected item(s)(or END):'.
- Say the first, third, and fourth items are desired. Enter a '1'.
- The system responds again as above. Enter a '3'. After the
- system responds, enter a '5'. Now after the system responds
- enter 'END'. This sequence of entries specifies that only items
- 1, 3, and 5 are to appear in the output. The data listing shown
- in figure 7 will appear on the screen.
-
-
-
-
-
-
-
-
-
-
-
-
-
- ---------------------------------------------------
- ID LAND8001 POPG8001 POPG8003
- ----- ----------- ----------- -----------
- 00000 0 3539289 0 226545805 0 640
- 01000 0 50767 0 3893888 0 767
- 02000 0 570833 0 401851 0 7
- ----- ----------- ----------- -----------
-
- 3 RECORDS LISTED
-
- HIT RETURN TO CONTINUE.
- ---------------------------------------------------
- Figure 7. Data listing sample
-
-
- This may take some time to appear if you are requesting records
- at the end of a long file. Hit RETURN. The master menu will
- reappear.
-
- E. Partitioning Data Files
-
- Enter '4', 'PRODUCE A SUBSET OF A DATA FILE'. The system will ask
- for the input file name. Enter 'DEMO1'. After reporting the
- number of items contained in the file, the system will ask for
- the output file name. Enter 'B:EXTRACT1'. When the system asks if
- you wish to select a subset of records respond 'YES'. The menu
- shown in figure 4 reappears. This time enter a '2', 'DISPLAY
- CURRENT SPECIFICATIONS'. The system will list the three codes
- specified above. (See fig. 6.) Hit RETURN. The same menu will
- reappear. Enter a '1', 'USE CURRENT STATE-COUNTY CODE
- SPECIFICATIONS'. The system will then ask 'DO YOU WISH TO SELECT
- A SUBSET OF ITEMS?' As before, select items 1,3, and 5. While
- processing the request, the system lists the area code of each
- record selected. The processing concludes with a statement of the
- number of records written to the output file followed by 'HIT
- RETURN TO CONTINUE'. A data dictionary for the output file is
- automatically created. Hit RETURN. The master menu reappears.
-
- Before proceeding, repeat the previous paragraph using DEMO2 as
- the input file name and B:EXTRACT2 as the output file name. Use
- the current specifications for record selection. Select items 2,
- 3, and 4 from each record.
-
- F. Combining Data Files
-
- Enter a '5', 'COMBINE TWO DATA FILES INTO ONE OUTPUT FILE'. The
- following text appears stating the rules for combining files and
- the consequence of their violation.
-
- THIS FUNCTION ASSUMES THAT THE TWO INPUT FILES HAVE THE SAME
- RECORD COUNT AND ARE IN THE SAME SEQUENCE.
- ANY MATCH FAILURE WILL RESULT IN TERMINATION OF THE REQUEST
- AND DELETION OF THE OUTPUT FILE. THE TWO MISMATCHED IDS WILL
- BE PRINTED.
-
- The user is given an option to cancel the request at this point.
- The system will request two input file names and one output file
- name. Use 'DEMO1' for the first input file, 'DEMO2' for the
- second input file and 'B:COMBO' for the output file. (Note that
- files EXTRACT1 and EXTRACT2 produced in the last section could
- have been used here but are not. EXTRACT1 will be used later in
- section G.) The system will then offer two options for selecting
- and ordering items for inclusion in the output file as shown in
- figure 8.
-
- -----------------------------------------------------------------
- ITEM SELECTION AND ORDERING OPTIONS
- -------------------------------------------------------------
- 1. ALL DATA ITEMS FROM BOTH INPUT FILES WILL BE PLACED IN THE
- OUTPUT FILE (INPUT FILE 1 ITEMS FOLLOWED BY INPUT FILE 2
- ITEMS).
- 2. USER WILL SELECT AND ORDER ITEMS.
- -------------------------------------------------------------
- ENTER NUMBER :
-
- -----------------------------------------------------------------
- Figure 8. Selection and ordering options menu
-
- Option 1 is simple and needs no further discussion. Enter a '2',
- 'USER WILL SELECT AND ORDER ITEMS'. The system will ask for the
- selection of items from the input files to be included in the
- output file. The system asks a pair of questions for each
- selected item: 'WHAT FILE IS THE NEXT ITEM TO BE SELECTED FROM (1
- OR 2)?' and 'WHAT IS THE SEQUENCE NUMBER OF THE ITEM WITHIN THAT
- FILE?'. (The user must refer to a printed version of the data
- dictionaries for the respective files to select the desired
- sequence numbers. See fig. 3 above.) This pair of questions is
- repeated until 'END' is entered in response to the first question
- of a pair. Enter responses for the following (file,sequence
- number) pairs: (1,3), (2,2), (2,3), (2,4), (2,5), (2,6).
- The specification procedure, when finished, will appear as shown
- in figure 9.
-
- -----------------------------------------------------------------------
- ENTER FILE FROM WHICH NEXT ITEM IS TO BE TAKEN (1 OR 2) (OR 'END') : 1
- ENTER THE NUMBER OF THE DESIRED ITEM FROM THAT FILE : 3
- ENTER FILE FROM WHICH NEXT ITEM IS TO BE TAKEN (1 OR 2) (OR 'END') : 2
- ENTER THE NUMBER OF THE DESIRED ITEM FROM THAT FILE : 2
- ENTER FILE FROM WHICH NEXT ITEM IS TO BE TAKEN (1 OR 2) (OR 'END') : 2
- ENTER THE NUMBER OF THE DESIRED ITEM FROM THAT FILE : 3
- ENTER FILE FROM WHICH NEXT ITEM IS TO BE TAKEN (1 OR 2) (OR 'END') : 2
- ENTER THE NUMBER OF THE DESIRED ITEM FROM THAT FILE : 4
- ENTER FILE FROM WHICH NEXT ITEM IS TO BE TAKEN (1 OR 2) (OR 'END') : 2
- ENTER THE NUMBER OF THE DESIRED ITEM FROM THAT FILE : 5
- ENTER FILE FROM WHICH NEXT ITEM IS TO BE TAKEN (1 OR 2) (OR 'END') : 2
- ENTER THE NUMBER OF THE DESIRED ITEM FROM THAT FILE : 6
- ENTER FILE FROM WHICH NEXT ITEM IS TO BE TAKEN (1 OR 2) (OR 'END') : END
- -------------------------------------------------------------------------
- Figure 9. Listing showing the specification of items for a combined file.
-
- After the user enters 'END', the system will process the request.
- The area codes will be listed on the screen as the processing
- proceeds. When finished, the system will report '93 RECORDS
- OUTPUT. HIT RETURN TO CONTINUE'. Hit RETURN.
-
-
- G. Copying Data Files With Area Names And Metro Codes Added
-
- UTILITYC is not designed to partition the geographic reference
- files (CCDB00.TXT for counties and CCDB40.TXT for cities). The
- system will, however, add the area names and metropolitan codes
- from the geographic reference files to the records of data files.
- This operation must be deferred until all desired partitions and
- recombinations of data files have been completed since the files
- output using this operation cannot serve as input to other
- UTILITYC operations. The typical application will append the area
- names and metropolitan codes as the final step before entering a
- data base package.
-
- From the master menu enter a '6', 'PRODUCE COPY OF A DATA FILE
- WITH AREA NAMES AND CODES ADDED'. The system will respond: 'ENTER
- DATA FILE NAME : '. Enter 'B:EXTRACT1'. The system will then
- respond: 'ENTER OUTPUT FILE NAME : '. Enter 'B:WITHNAME'. The
- system will then respond: 'ENTER GEOGRAPHIC REFERENCE FILE
- NAME : '. Enter 'DEMONAME'. (When dealing with the actual CCDB
- file sets you wil enter 'CCDB00' for the county geographic
- reference file or 'CCDB40' for the city geographic reference
- file.) The system will list the State-county codes on the data
- file as they are matched by records from the geographic
- reference file. Upon completion, the system will report:
- 'NAMES AND CODES ADDED TO 3 RECORDS. HIT RETURN TO CONTINUE.'.
- Hit RETURN. The master menu will reappear. The system does
- not provide a means of listing this output file. To do
- that we must first exit from UTILITYC. Enter a '7', 'FINISHED
- WITH UTILITYC PROGRAM'. 'A>' should appear on your screen.
- Turn your printer on and enter 'TYPE B:WITHNAME'. The listing
- should appear as shown in figure 10.
-
- -------------------------------------------------------------------
- A>TYPE B:WITHNAME
- 00000, , , , ,"UNITED STATES",0,3539289,0,
- 226545805,0,640
- 01000, , , , ,"ALABAMA",0,50767,0,3893888,0,767
- 02000, , , , ,"ALASKA",0,570833,0,401851,0,7
- -------------------------------------------------------------------
- Figure 10. Listing of file with names and codes attached
-
-
-
-
-
-